package gui;

import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JList;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class VAgregarALista extends JPanel {

	/**
	 * Create the panel.
	 */
	public VAgregarALista() {
		
		String[] data = {"one", "two", "three", "four"};
		
		JLabel lblLista = new JLabel("Lista:");
		add(lblLista);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"Lista1", "Lista2", "Lista3", "Lista4"}));
		add(comboBox);
		
		JButton btnAadir = new JButton("A\u00F1adir");
		add(btnAadir);
		
		JButton btnCrearLista = new JButton("Crear Lista");
		btnCrearLista.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				VListaRepNueva nuevaLista = new VListaRepNueva();
				nuevaLista.setResizable(false);
				nuevaLista.setModal(true);
				nuevaLista.pack();
				nuevaLista.setVisible(true);
			}
		});
		add(btnCrearLista);
		
		final JButton btnCancelar = new JButton("Cancelar");
		btnCancelar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				btnCancelar.getParent().setVisible(false);
			}
		});
		add(btnCancelar);
		
		

	}

}
